/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Interpreter.Function.List;

import Interpreter.Function.Function;
import Interpreter.InterpreterVisitor;
import ast.AST;
import java.util.ArrayList;

/**
 *
 * @author Stephen
 */
public class LastFunction extends Function {
    
    @Override
    public Object execute(ArrayList args) {
        ArrayList myList = (ArrayList) ((AST)args.get(0)).accept(new InterpreterVisitor());
        return myList.get(myList.size()-1);
    }
}
